<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户管理/编辑页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/systemStatic/style/admin.css">
    <link rel="stylesheet" href="${ctx}/extends/zTree_v3/css/zTreeStyle/zTreeStyle.css"/>
    <link rel="stylesheet" href="${ctx}/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/css/public.css">
</head>
<body>
<div class="layui-row">
    <form class="layui-form" requrl="${ctx}/qbdms/qbdms/one" lay-filter="demoForm" onsubmit="return false;">
        <div class="layui-tab layui-tab-card" style="height:580px">
            <ul class="layui-tab-title">
                <li class="layui-this">基本信息</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item" style="display: none">
                        <label class="layui-form-label">主键</label>
                        <div class="layui-input-block">
                            <input type="text" name="demoId"  placeholder="请输入"
                                   autocomplete="off" class="layui-input " maxlength="50" fieldname="demoId">
                        </div>
                    </div>
                    <table class="table-detail">
                        <tr>
                            <th style="border-bottom:none;border-right:none;background: #f2f2f2;">示例姓名:<span
                                    style="color:red">*</span></th>
                            <td style="border-bottom:none;"><input type="text" name="demoName" fieldname="demoName" autocomplete="off"
                                                                   class="layui-input" lay-verify="required|names"
                                                                   maxlength="10" ></td>
                        </tr>
                        <tr>
                            <th style="border-bottom:none;border-right:none;background: #f2f2f2;">示例类型:</th>
                            <td style="border-bottom:none;">
                                <select name="demoType" fieldname="demoType" style="height:22px">
                                    <option value="0">状态0</option>
                                    <option value="1">状态1</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
            <div class="layui-form-item">
                <div style="text-align: center">
                    <a lay-submit requrl="${ctx}/qbdms/qbdms/qbdmsUpdate" lay-filter="demoSubmit" class="layui-btn btn-n">保存</a>
                    <a class="layui-btn layui-btn-danger btn-cancel">取消</a>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="${ctx}/extends/jquery.min.js" type="text/javascript"></script>
<script src="${ctx}/public/component.js" type="text/javascript"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.systemPath + staticPath.systemPath //静态资源所在路径
    }).extend({
        index: 'index' //主入口模块
    }).use(['index', 'form', 'layer', 'commons', 'util','common'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery,
            commons = layui.commons;
        form.render();
        form.verify(commons.formVerify);
        //修改数据
        var common = layui.common;
        common.updateForm({
            name:'demoForm',
            idValue:"${demoId}",
            primary:"id",
            updateCallback:function (data) {
                if (commons._filterRecord(data)) {
                    layer.alert(data.msg, function (index) {
                        layer.close(index);
                        parent.layui.table.reload('demoListTable', {
                            page: {curr: 1}
                        });
                        parent.layui.totalFilter.init('demoListTable');
                        parent.window.Initialization();
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                    });
                } else {
                    layer.alert(data.msg);
                }
                return false;
            }
        });
        //取消按钮事件
        $(".btn-cancel").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        });
    })

</script>
</body>
</html>